import {defineStore, storeToRefs} from "pinia";
import {getGuidApi} from "@/api/modules/system/common.js";
import {getInterfaceEnvListApi} from "@/api/modules/interface/interface.js";
import {useProjectStore} from "@/stores/modules/project/project.js";
const projectStore = useProjectStore()

const {currentProject, currentProjectId} = storeToRefs(projectStore)

export const useInterfaceEnvSettingStore = defineStore({
    id: "chestnut-interfaceEnvSetting",
    state: () => ({
        interfaceEnvList: []
    }),
    actions: {
        getInterfaceEnvList(){
            getInterfaceEnvListApi({projectId:currentProjectId.value}).then(res=>{
                this.interfaceEnvList = []
                this.interfaceEnvList = res.data.data
            })
        }

    }
})
